home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AOL File Library: 2,801 to 2,900
/
aol-file-protocol-4400-2801-to-2900.zip
/
AOLDLs
/
C++ Files Library
/
MRDiim, 3D World Shell
/
MRDiim.sit
/
MRDiim
/
MRConstruction.h
< prev
next >
Wrap
Text File
|
1994-12-19
|
3KB
|
109 lines
// defines a post within the world, shown as a post
typedef struct {float myX; float myY;} ChartPost;
// use as a filler
const ChartPost ZeroZeroPost={0,0};
// defines a wall
typedef struct {ChartPost CP1; ChartPost CP2; } ChartWall;
// defines a bitmapped wall
typedef struct {ChartPost CP1; ChartPost CP2 ; short pictID; } ChartBitmap;
// define directions
enum chartDirection {forward=1,rightside,backside,leftside};
// max viewable distance
const MaxViewDistance = 10;
// consts for diim grid view
const GridX = 150;
const GridY = 150;
// size of a step
const float HumanStep = .5;
// holds ratio of gradX to gridY
const ViewRatio = 1;
// how man "units" the viewer is is height
const UnitHeight = 2;
// half way marks
const HorizonLine = (GridY/2);
const MeridianLine = (GridX/2);
// ratio of factor for expanding ticks. fyi... 1.57 = half pi
const float MyPi = 3.1415926535;
const float MyHalfPi = 1.5707963268;
const HorizSpan = (HorizonLine / 1.5707963268);
const MerdSpan = (MeridianLine / 1.5707963268);
const WidthOfWorld = 10;
const HeightOfWorld = 10;
inline float Min(float A,float B)
{
if(A<B)
return(A);
else
return(B);
} ;
inline float Max(float A,float B)
{
if(A>B)
return(A);
else
return(B);
} ;
inline ChartPost DiffChartPost(ChartPost CP1,ChartPost CP2)
{
ChartPost CP={0,0};
CP.myX=CP1.myX-CP2.myX;
CP.myY=CP1.myY-CP2.myY;
return(CP);
}
inline ChartPost AveChartPost(ChartPost CP1,ChartPost CP2)
{
ChartPost CP={(CP1.myX+CP2.myX)/2,(CP1.myY+CP2.myY)/2};
return(CP);
}
class MRConstruction: public MRRachet
{
short myBuildType;
void *myStructure; // data structure of fixed location
void *myActors; // data structure of relative locations
float oDistance; // distance of MRC to the point of view
char myWallType; // type of item (used to color)
static float maxDist; // used in determining order of drawing
static float nextDist;
public:
MRConstruction(short Number=0,Boolean toMark=false);
virtual ~MRConstruction(void);
// override
virtual void *NewRachet(short Number,Boolean toMark);
virtual void ZapRachet(Ptr toBeZapped);
virtual void AddConstruction(ChartPost theCP, char wallType); // post
virtual void AddConstruction(ChartWall theCW, char wallType); // wall
//virtual void PrepConstruction(chartDirection myDirection,short myDist);
virtual void DoConstruction(void);
virtual void FindActors(ChartPost myself,float facing,Boolean halfCircle);
virtual void PrepScanStart(void);
virtual void PrepScan(void);
virtual void ScanConstruction(void);
virtual Boolean ProposedMove(ChartPost myMove);
} ;
void DrawPost(ChartPost CP);
void DrawWall(ChartPost CP1,ChartPost CP2,char wallType);
Point FindFooter(ChartPost CP);
ChartPost FindActor(ChartPost target,float rads, Boolean halfCircle);
void NormalizeAngle(float &facing, Boolean &halfCircle);
ChartPost ReturnChartPost(float myX,float myY);
ChartWall ReturnChartWall(ChartPost CP1,ChartPost CP2);
ChartWall LowHigh(ChartPost lowCP,ChartPost highCP);